
#include "benchmark/benchmark.h"
#include <cstring>

#define REPEAT2(x) x x
#define REPEAT4(x) REPEAT2(x) REPEAT2(x)
#define REPEAT8(x) REPEAT4(x) REPEAT4(x)
#define REPEAT16(x) REPEAT8(x) REPEAT8(x)
#define REPEAT32(x) REPEAT16(x) REPEAT16(x)
#define REPEAT(x) REPEAT32(x)

void BM_false_branch(benchmark::State& state)
{
    volatile int* p = new int;
    *p = 42;
    for (auto _ : state) {
        REPEAT(benchmark::DoNotOptimize(*p);)
    }
    delete p;
}

#define ARGS \
    ->Arg(1 << 22)

BENCHMARK(BM_false_branch) ARGS;

BENCHMARK_MAIN();
